package p2000;

import java.util.Scanner;

public class Main2021发工资咯 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();

            if (n == 0) {
                break;
            }

            int sum = 0;
            while (n-- > 0) {
                int a = scanner.nextInt();
                sum += a / 100;
                a = a % 100;
                sum += a / 50;
                a = a % 50;
                sum += a / 10;
                a = a % 10;
                sum += a / 5;
                a = a % 5;
                sum += a / 2;
                a = a % 2;
                sum += a;
            }

            System.out.println(sum);
        }
    }

}
